package com.nbb.demo.shardingjdbc.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import groovy.transform.builder.Builder;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @description:
 * @author: Jerry
 * @time: 2021/3/26 15:44
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName("user")
public class User extends Model<User> {

    @TableId(value = "id", type = IdType.ASSIGN_ID) //雪花算法用这个类型
//    @TableId(value = "id", type = IdType.INPUT) //自己setId 用这个类型
    private Long id;

    @TableField("username")
    private String username;

    @TableField("password")
    private String password;
}
